'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH LOGINDEVPERM 5 "Sep 25, 2008"
.SH NAME
logindevperm, fbtab \- login-based device permissions
.SH SYNOPSIS
.LP
.nf
\fB/etc/logindevperm\fR
.fi

.SH DESCRIPTION
.sp
.LP
The \fB/etc/logindevperm\fR file contains information that is used by
\fBlogin\fR(1) and \fBttymon\fR(8) to change the owner, group, and permissions
of devices upon logging into or out of a console device. By default, this file
contains lines for the keyboard, mouse, audio, and frame buffer devices.
.sp
.LP
The owner of the devices listed in \fB/etc/logindevperm\fR is set to the owner
of the console by \fBlogin\fR(1). The group of the devices is set to the
owner's group specified in \fB/etc/passwd\fR. The permissions are set as
specified in \fB/etc/logindevperm\fR.
.sp
.LP
If the console is \fB/dev/vt/active\fR, the owner of the devices is the first
user logged in on the consoles (\fB/dev/console\fR or \fB/dev/vt/#\fR). Upon
this first user's logout the owner and group of these devices is reset by
\fBttymon\fR(8) to owner root and root's group as specified in
\fB/etc/passwd\fR.
.sp
.LP
Fields are separated by a TAB or SPACE characters. Blank lines and comments can
appear anywhere in the file; comments start with a hashmark, (\fB#\fR), and
continue to the end of the line.
.sp
.LP
The first field specifies the name of a console device (for example,
\fB/dev/console\fR). By default, it is \fB/dev/vt/active\fR, which points to
the current active console, including \fB/dev/console\fR and all virtual
consoles (\fB/dev/vt/#\fR). The second field specifies the permissions to which
the devices in the \fIdevice_list\fR field (third field) are set. These
permissions must be expressed in octal format, for example, \fB0774\fR. A
\fIdevice_list\fR is a colon-separated list of device names. A device name must
be a \fB/dev\fR link.
.sp
.LP
A directory or logical name in the device name can be either one of the
following:
.RS +4
.TP
.ie t \(bu
.el o
A fully qualified name, for example, \fBfbs\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
A regular expression, for example, \fB[a-z0-9.]+\fR. See \fBregexp\fR(7) for
more information on regular expressions.
.RE
.RS +4
.TP
.ie t \(bu
.el o
The wildcard character \fB*\fR specifying all directory or node names (except
\fB\&.\fR and \fB\&..\fR, for example, \fB/dev/fbs/*\fR specifies all frame
buffer devices.
.RE
.sp
.LP
Some examples of \fB/etc/logindevperm\fR file entries include:
.sp
.in +2
.nf
/dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/[a-z0-9.]+
/dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/*
/dev/usb/[0-9a-f]+[.][0-9a-f]+/*/*
.fi
.in -2

.sp
.LP
Specify all \fBugen\fR(4D) endpoints and status nodes.
.sp
.LP
Drivers can also be specified to limit the permission changes to minor nodes
owned by the specified drivers. For example,
.sp
.in +2
.nf
/dev/console    0600    /dev/usb/[0-9a-f]+[.][0-9a-f]+/[0-9]+/* \e
driver=usb_mid,scsa2usb,usbprn  # libusb devices
.fi
.in -2

.sp
.LP
Due to the persistence of \fBdevfs\fR(4FS) minor node management, the user
should be logged in as root if the list of minor nodes will be reduced and the
devices should all be plugged in.
.sp
.LP
Once the devices are owned by the user, their permissions and ownership can be
changed using \fBchmod\fR(1) and \fBchown\fR(1), as with any other user-owned
file.
.sp
.LP
Upon logout the owner and group of these devices are reset by \fBttymon\fR(8)
to owner \fBroot\fR and root's group as specified in \fB/etc/passwd\fR
(typically \fBother\fR). The permissions are set as specified in the
\fB/etc/logindevperm\fR file.
.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 15n
File that contains user group information.
.RE

.SH SEE ALSO
.sp
.LP
.BR chmod (1),
.BR chown (1),
.BR login (1),
.BR ugen (4D),
.BR passwd (5),
.BR regexp (7),
.BR ttymon (8)
.SH NOTES
.sp
.LP
\fB/etc/logindevperm\fR provides a superset of the functionality provided by
\fB/etc/fbtab\fR in SunOS 4.\fIx\fR releases.
